package lt.startup.duobes;

import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;

public class SettingsActivity extends Activity {

	private SeekBar seekbar;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings);
	
		final TextView text = (TextView) findViewById(R.id.senseText);
		text.setText(String.valueOf(Constants.sence));
		
		seekbar = (SeekBar) findViewById(R.id.sensi_input);
		seekbar.setProgress((int)((Constants.sence-4)*10));
		seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
					Constants.savePreferences(getApplicationContext());			
			}
			
			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {								
			}
			
			@Override
			public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
				Constants.sence = 4 + progress/10f;
				text.setText(String.valueOf(Constants.sence));
			}
		});
		
	}

	

}